Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Dottips do not disappear when other parts of the editor are engaged #17663

Conversation

jorgefilipecosta
Copy link
Member

Fixes: #8181

This PR makes DotTips disappear when a click outside happens. The logic got a little bit more complex because we want to allow clicks on the target (outside the popover), so if the tip says to click the inserter and the user clicks the inserter the dot tips do not disappear.

How has this been tested?

I opened block editor.
I cleaned the local storage by executing window.localStorage.clear(); on the browser console.
I refreshed block editor and verified tips close if I click/focus outside them.
I redid the test and verified tips don't close if their target is clicked e.g: inserter on the first one.

cc: @mapk as the creator of the issue.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Feature] NUX Anything that impacts the new user experience [Package] NUX labels Sep 30, 2019
@noisysocks
Copy link
Member

These changes look good but I'm wondering if we should instead proceed with #16315 and deprecate the InlineTip component altogether.

@jorgefilipecosta
Copy link
Member Author

These changes look good but I'm wondering if we should instead proceed with #16315 and deprecate the InlineTip component altogether.

I was not aware of these changes, but I think we can advance with this PR, for now, as it fixes a bug in the DotTip component and even if we deprecate plugins may still use that component as it is part of our public API.
Also, it may take some time until the other proposal is finished and if this PR is ready we solve this bug right away :)

Copy link
Contributor

@mapk mapk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked great. Clicking away from the Tip closed the tips completely. 👍

@jorgefilipecosta jorgefilipecosta force-pushed the fix/dottips-does-not-disappear-when-other-parts-of-the-editor-are-engaged branch 2 times, most recently from e932491 to 93f1794 Compare October 4, 2019 13:10
@jorgefilipecosta jorgefilipecosta force-pushed the fix/dottips-does-not-disappear-when-other-parts-of-the-editor-are-engaged branch from 93f1794 to 4f858ca Compare October 4, 2019 13:55
@jorgefilipecosta jorgefilipecosta merged commit f68a107 into master Oct 4, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/dottips-does-not-disappear-when-other-parts-of-the-editor-are-engaged branch October 4, 2019 15:22
@youknowriad youknowriad added this to the Gutenberg 6.7 milestone Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] NUX Anything that impacts the new user experience [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tips: The tooltip didn't disappear when other parts of the editor are engaged
4 participants